#pragma once

#include "geometry.h"

class Edge {
public:
    Edge();
    Edge(int index, Vertex* a, Vertex* b, int sharpness, bool opt);
    int index;
    int sharpness;
    bool opt;
    Vertex* startVertex;
    Vertex* endVertex;
    Face* forwardFace;
    Face* reverseFace;

    //pointer to the next vertex in the Catmull-Clark subdivision.
    Vertex* ccVertex;
    Edge* startEdge;
    Edge* endEdge;

    Vector3d midpoint() const;
    void setCC(Vertex* v, Edge* a, Edge* b);

    bool equalEndpoints(int a, int b) const;

    Vertex* getOpposite(const Vertex* v) const;
    Face* getRightFace(const Vertex* v) const;
};
